package org.xjtu.weteam.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 权限拒绝异常类，用于处理用户权限不足的情况
 * @author Kevin
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PermissionDeniedException extends RuntimeException {
    private String message;
    private int code;

    public PermissionDeniedException(String message) {
        this(message, 403); // 默认错误代码为403
    }

    @Override
    public String getMessage() {
        return message; // 获取异常消息
    }
}
